package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

public class ExecutorDemo {
    private ExecutorService service;


    public ExecutorDemo(char type) {
        service = ExecutorFactory.create(type);
    }

    public Future<?> submit(RunnableClass runnable){
        return service.submit(runnable);
    }

    public void execute(RunnableClass runnable){
        service.execute(runnable);
    }

    public void release(){
        service.shutdown();
    }
}
